package app.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;

import app.thread.ScanLoginThread;
import app.util.ThreadUtil;

/**
 * servlet加载完成后执行
 * @author zoe
 *
 */
public class InitProjectListener implements ServletContextListener {
	
	private static Logger logger = Logger.getLogger(InitProjectListener.class);
	
	@Override
	public void contextDestroyed(ServletContextEvent servletcontextevent) {
		
	}

	@Override
	public void contextInitialized(ServletContextEvent servletcontextevent) {
		logger.info("===============启动自定义监听2===============");
		ScanLoginThread target = new ScanLoginThread();
		ThreadUtil.newCachedThreadPool.execute(target);
		ThreadUtil.setRunningThread(ScanLoginThread.class.getName(), target);
		logger.info("===============结束自定义监听===============");
	}

}
